package bill.study.playground;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class HowArraysCopyOfWorks {

	public static void main(String[] args) {
		List<StringBuilder> list = new ArrayList<StringBuilder>();
		list.add(new StringBuilder("Hello"));
		StringBuilder[] arr = list.toArray(new StringBuilder[] {});
		arr[0].append(" world");
		System.out.println(arr[0]);
		System.out.println(list);

		StringBuilder[] sb = new StringBuilder[] { new StringBuilder("Simon"),
				new StringBuilder("Tony") };
		
		StringBuilder[] sb2 = Arrays.copyOf(sb,2);
		sb[0] = new StringBuilder("Bill");
		sb[1].append("liu");
		
		System.out.println(sb2[0] + " " + sb2[1]);
		
		
	}

}
